// sort rules
function sortRules(props, type) {
  type = type || 0
  return function(a, b) {
    if (type === 1) {
      return a[props] - b[props]
    } else {
      return b[props] - a[props]
    }
  }
}
// sort by some argments
function sortBy(props) {
  var type = 0
  if (props === 'id' || props === 'price') {
    type = 1
  }
  data.sort(sortRules(props, type))
  renderList(data)
}
